<template>
  <div class="use-info">
    <el-form :model="form" ref="form" style="font-size: 12px;" label-width="99px" size="mini" :rules="addRules" :disabled="formDisabled || mode === 'view'">
      <el-row :gutter="24">
        <!-- 高危药品、是否液体等原有表单项保持不变... -->
        
        <!-- 新增的textarea类型表单项 -->
        <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
          <el-form-item label="药理作用：" prop="phamAction">
            <el-input
              type="textarea"
              :rows="2"
              v-model="form.phamAction"
              @blur="updateForm"
              placeholder="请输入药理作用">
            </el-input>
          </el-form-item>
        </el-col>
        
        <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
          <el-form-item label="适应症：" prop="efccAtd">
            <el-input
              type="textarea"
              :rows="2"
              v-model="form.efccAtd"
              @blur="updateForm"
              placeholder="请输入适应症">
            </el-input>
          </el-form-item>
        </el-col>
        
        <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
          <el-form-item label="用法用量：" prop="usedMtd">
            <el-input
              type="textarea"
              :rows="2"
              v-model="form.usedMtd"
              @blur="updateForm"
              placeholder="请输入用法用量">
            </el-input>
          </el-form-item>
        </el-col>
        
        <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
          <el-form-item label="药代动力学：" prop="phas">
            <el-input
              type="textarea"
              :rows="2"
              v-model="form.phas"
              @blur="updateForm"
              placeholder="请输入药代动力学">
            </el-input>
          </el-form-item>
        </el-col>
        
        <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
          <el-form-item label="不良反应：" prop="defs">
            <el-input
              type="textarea"
              :rows="2"
              v-model="form.defs"
              @blur="updateForm"
              placeholder="请输入不良反应">
            </el-input>
          </el-form-item>
        </el-col>
        
        <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
          <el-form-item label="注意事项：" prop="mnan">
            <el-input
              type="textarea"
              :rows="2"
              v-model="form.mnan"
              @blur="updateForm"
              placeholder="请输入注意事项">
            </el-input>
          </el-form-item>
        </el-col>
        
        <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
          <el-form-item label="禁忌说明：" prop="tabo">
            <el-input
              type="textarea"
              :rows="2"
              v-model="form.tabo"
              @blur="updateForm"
              placeholder="请输入禁忌说明">
            </el-input>
          </el-form-item>
        </el-col>
        
        <!-- 原有其他表单项保持不变... -->
      </el-row>
    </el-form>
  </div>
</template>

<script>
export default {
  props: {
    form: {
      type: Object,
      required: true
    },
    formDisabled: {
      type: Boolean,
      default: false
    },
    mode: {
      type: String,
      default: 'add' // 'add', 'edit', 'view'
    }
  },
  data() {
    return {
		addRules:{},
      // 原有数据保持不变...
    };
  },
  methods: {
    updateForm() {
      this.$emit('update', this.form);
    },
	resetForm() {
	  // 重置所有文本字段
	  this.form.phamAction = '';
	  this.form.efccAtd = '';
	  this.form.usedMtd = '';
	  this.form.phas = '';
	  this.form.defs = '';
	  this.form.mnan = '';
	  this.form.tabo = '';
	  
	  // 重置表单验证
	  if (this.$refs.form) {
	    this.$refs.form.clearValidate();
	  }
	},
    // 原有方法保持不变...
  }
};
</script>

<style lang="less" scoped>
/deep/ .el-form-item{
  margin-bottom: 2px;
}
.basic-info {
  padding: 4px;
  /deep/ .el-form-item__label{
    font-size: 12px;
  }
  /deep/ .el-input__inner{
    padding: 0 4px;
  }
  /deep/ .el-form-item__content{
    display: flex;
    justify-content: space-around;
  }
  /deep/ .el-input--mini .el-input__inner{
    height: 26px;
  }
  
  /* 新增textarea样式 */
  /deep/ .el-textarea {
    width: 100%;
    .el-textarea__inner {
      min-height: 40px !important;
      font-size: 12px;
    }
  }
}
</style>